package com.echo.acc.controller;

import com.echo.acc.framework.aspect.OperationLog;
import com.echo.acc.service.TemplateFileReaderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * .md文件内容的读取
 *
 * @author echo
 * date 2023-12-25 15:13:24
 **/
@RestController
public class MdFileContentController {

    @Autowired
    private TemplateFileReaderService templateFileReaderService;

    @OperationLog(desc = "文档读取")
    @GetMapping(value = "/getMarkdownContent/{fileName}", produces = "text/plain;charset=UTF-8")
    public String getMarkdownContent(@PathVariable String fileName) {
        return templateFileReaderService.readTemplateFile(fileName);
    }

}
